<?php

class ModelCatalogCountry extends Model
{
    private $COUNTRY_DATA = array();

    public function __construct()
    {
        $this->getCountryData();
    }

    public function getCountryData()
    {
        $this->COUNTRY_DATA = array(
            1 => array(
                "continentName" => "ASIA",
                "country" => array(
                    1 => array(
                        "countryName" => "VIETNAM",
                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/VIETNAM/vn.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "NHATRANG",
                                "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/VIETNAM/nhatrang.png",
                                "place" => array(
                                    1 => array(
                                        "placeName" => "Vinperland",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/VIETNAM/NHATRANG/Vinperland.png"
                                    ),
                                    2 => array(
                                        "placeName" => "DaoKhi",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/VIETNAM/NHATRANG/daokhi.png"
                                    ),
                                )

                            ),
                            2 => array(
                                "cityName" => "PHANTHIET",
                                "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/VIETNAM/phanthiet.png",
                                "place" => array(
                                    1 => array(
                                        "placeName" => "MuiNe",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/VIETNAM/PHANTHIET/daokhi.png"
                                    )
                                )
                            )
                        )
                    ),
                    2 => array(
                        "countryName" => "CHINA",
                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/CHINA/cn.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "BACKINH",
                                "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/CHINA/backinh.png",
                                "place" => array(
                                    1 => array(
                                        "placeName" => "VAN LY TRUONG THANH",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/CHINA/BACKINH/vanly.png"
                                    ),
                                    2 => array(
                                        "placeName" => "BAC KINH CITY",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/CHINA/BACKINH/city.png"
                                    )
                                )

                            ),
                            2 => array(
                                "cityName" => "SANGHAI",
                                "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/CHINA/sanghai.png",
                                "place" => array(
                                    1 => array(
                                        "placeName" => "SANGHAICITY",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/CHINA/SANGHAI/city.png"
                                    )
                                )
                            )
                        )
                    ),
                    3 => array(
                        "countryName" => "THAILAND",
                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/THAILAND/thailand.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Bangkok",
                                "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/THAILAND/bangkok.png",
                                "place" => array(
                                    1 => array(
                                        "placeName" => "Bangkok city",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/THAILAND/Bangkok/city.png"
                                    )
                                )

                            )
                        )
                    ),
                    4 => array(
                        "countryName" => "SINGAPORE",
                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/SINGAPORE/singapore.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "singapore",
                                "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/SINGAPORE/singapore_city.png",
                                "place" => array(
                                    1 => array(
                                        "placeName" => "tower",
                                        "image" => "/" . DIR_ROOT_NAME . "/image/ASIA/SINGAPORE/tower.png"
                                    )
                                )
                            )
                        )
                    )
                )
            ),
            2 => array(
                "continentName" => "EUROPE",
                "country" => array(
                    1 => array(
                        "countryName" => "Austria",
                        "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Austria/Austria.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Vienna",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Austria/Vienna.png",
                            ),
                            2 => array(
                                "cityName" => "Salzburg",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Austria/Salzburg.png",
                            ),
                            3 => array(
                                "cityName" => "Innsbruck",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Austria/Innsbruck.png",
                            )
                        )
                    ),
                    2 => array(
                        "countryName" => "France",
                        "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/France/France.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Paris",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/France/Paris.png",
                            ),
                            2 => array(
                                "cityName" => "Cannes",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/France/Cannes.png",
                            ),
                            3 => array(
                                "cityName" => "Nice",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/France/Nice.png",
                            )
                        )
                    ),
                    3 => array(
                        "countryName" => "Italy",
                        "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Italy/Italy.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Rome",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Italy/Rome.png",
                            ),
                            2 => array(
                                "cityName" => "Venice",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Italy/Venice.png",
                            ),
                            3 => array(
                                "cityName" => "Milan",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Italy/Milan.png",
                            ),
                            4 => array(
                                "cityName" => "Naples",
                                "image" => "/" . DIR_ROOT_NAME . "/image/EUROPE/Italy/Naples.png",
                            )
                        )
                    )
                )
            ),
            3 => array(
                "continentName" => "NORTH AMERICA",
                "country" => array(
                    1 => array(
                        "countryName" => "CANADA",
                        "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/CANADA/Canada.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Bathsheba",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/CANADA/Bathsheba.png"
                            )
                        )
                    ),
                    2 => array(
                        "countryName" => "MEXICO",
                        "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/MEXICO/Mexico.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Cancun",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/MEXICO/Cancun.png"
                            ),
                            2 => array(
                                "cityName" => "Ensenada",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/MEXICO/Ensenada.png"
                            ),
                            3 => array(
                                "cityName" => "Mexico City",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/MEXICO/MexicoCity.png"
                            )
                        )
                    ),
                    3 => array(
                        "countryName" => "AMERICA",
                        "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/us.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Atalanta",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Atalanta.png"
                            ),
                            2 => array(
                                "cityName" => "Atalantic",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Atalantic.png"
                            ),
                            3 => array(
                                "cityName" => "Boston",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Boston.png"
                            ),
                            4 => array(
                                "cityName" => "Chicago",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Chicago.png"
                            ),
                            5 => array(
                                "cityName" => "Dallas",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Dallas.png"
                            ),
                            6 => array(
                                "cityName" => "Fort Lauderdale",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/FortLauderdale.png"
                            ),
                            7 => array(
                                "cityName" => "Honoluu",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Honoluu.png"
                            ),
                            8 => array(
                                "cityName" => "Houston",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Houston.png"
                            ),
                            9 => array(
                                "cityName" => "Key West",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/KeyWest.png"
                            ),
                            10 => array(
                                "cityName" => "LasVegas",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/LasVegas.png"
                            ),
                            11 => array(
                                "cityName" => "Lost Angeles",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/LostAngeles.png"
                            ),
                            12 => array(
                                "cityName" => "Miami",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Miami.png"
                            ),
                            13 => array(
                                "cityName" => "Myrtle Beach",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/MyrtleBeach.png"
                            ),
                            14 => array(
                                "cityName" => "New York",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/NewYork.png"
                            ),
                            15 => array(
                                "cityName" => "Orlando",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Orlando.png"
                            ),
                            16 => array(
                                "cityName" => "Philadelphia",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Philadelphia.png"
                            ),
                            17 => array(
                                "cityName" => "Richmond",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Richmond.png"
                            ),
                            18 => array(
                                "cityName" => "San Antonio",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/SanAntonio.png"
                            ),
                            19 => array(
                                "cityName" => "San Diego",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/SanDiego.png"
                            ),
                            20 => array(
                                "cityName" => "San Francisco",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/SanFrancisco.png"
                            ),
                            21 => array(
                                "cityName" => "San Jose",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/SanJose.png"
                            ),
                            22 => array(
                                "cityName" => "Seattle",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/Seattle.png"
                            ),
                            23 => array(
                                "cityName" => "Washington, DC",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/WashingtonDC.png"
                            ),
                            24 => array(
                                "cityName" => "Yosemite Valley",
                                "image" => "/" . DIR_ROOT_NAME . "/image/NORTH_AMERICA/US/YosemiteValley.png"
                            )
                        )
                    )
                )
            ),
            4 => array(
                "continentName" => "SOUTH AMERICA",
                "country" => array(
                    1 => array(
                        "countryName" => "Argentina",
                        "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Argentina/Argentina.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Buenos Aires",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Argentina/BuenosAires.png"
                            ),
                            2 => array(
                                "cityName" => "Cafayate",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Argentina/Cafayate.png"
                            ),
                            3 => array(
                                "cityName" => "Cordoba",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Argentina/Cordoba.png"
                            )
                        )
                    ),
                    2 => array(
                        "countryName" => "Brazil",
                        "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/Brazil.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Fortaleza",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/Fortaleza.png"
                            ),
                            2 => array(
                                "cityName" => "Manaus",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/Manaus.png"
                            ),
                            3 => array(
                                "cityName" => "Natal",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/Natal.png"
                            ),
                            4 => array(
                                "cityName" => "Paraty",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/Paraty.png"
                            ),
                            5 => array(
                                "cityName" => "Rio De Janeiro",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/RioDeJaneiro.png"
                            ),
                            6 => array(
                                "cityName" => "Salvador",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/Salvador.png"
                            ),
                            7 => array(
                                "cityName" => "SaoPaulo",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Brazil/SaoPaulo.png"
                            )
                        )
                    ),
                    2 => array(
                        "countryName" => "Colombia",
                        "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Colombia/Colombia.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Bogota",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Colombia/Bogota.png"
                            )
                        )
                    ),
                    3 => array(
                        "countryName" => "Peru",
                        "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Peru/Peru.png",
                        "city" => array(
                            1 => array(
                                "cityName" => "Cusco",
                                "image" => "/" . DIR_ROOT_NAME . "/image/SOUTH_AMERICA/Peru/Cusco.png"
                            )
                        )
                    ),
                )
            ),
        );
        return $this->COUNTRY_DATA;
    }

    public function getCountries($continentName)
    {
        $countryData = $this->COUNTRY_DATA;
        foreach ($countryData as $continentIndex) {
            if ($continentIndex['continentName'] == $continentName) {
                return $continentIndex['country'];
            }
        }
        return array();
    }

    public function getCities($countryName)
    {
        $countryData = $this->COUNTRY_DATA;
        foreach ($countryData as $continentIndex) {
            foreach ($continentIndex['country'] as $country) {
                if ($country['countryName'] == $countryName) {
                    return $country['city'];
                }
            }
        }
        return array();
    }
}

?>